package com.heima.article.controller.v1;

import com.heima.article.entity.ApAuthor;
import com.heima.article.service.ApAuthorService;
import com.heima.model.article.dtos.AuthorDto;
import com.heima.model.media.dtos.WmNewsResultDTO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
public class articleUserController {

    @Autowired
    private ApAuthorService apAuthorService;

    /**
     *  审核通过  创建文章的作者
     * @param dto
     * @return
     */
    @PostMapping("/api/v1/author/save")
    public Integer createAuthor(@RequestBody AuthorDto dto){
       // int i = 1/0;
        return apAuthorService.createAuthor(dto);
    }

    @GetMapping("/api/v1/author/{wmuserid}")
    public ApAuthor findAuthor(@PathVariable Integer wmuserid){
        return apAuthorService.findAuthor(wmuserid);
    }



}
